// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  app: {
    head: {
      title: "知崖SSR",
      meta: [
        { charset: "utf-8" },
        { name: "keywords", content: "个人博客，前端，面试" },
        { name: "description", content: "魏熙金的个人博客" },
      ],
      link: [{ rel: "icon", href: "/logo.png" }],

    },
  },
  vite: {
    css: {
      preprocessorOptions: {
        scss: {
          // additionalData: '@import "@/assets/_colors.scss";@import "@/assets/index.css";',
        },
      },
    },
  },

  runtimeConfig: {
    server: "server", // 配置服务器端才能访问的环境变量
    isServer: true,
    public: {
      // 配置客户端和服务器端都能访问的环境变量
      client: "client",
    },
  },

  // 设置渲染策略
  routeRules: [
    {
      "/admin/**": { ssr: false }, // 禁用服务端渲染
      "/login": { ssr: false }, // 禁用服务端渲染
      "/blog/**": { swr: false }, // 启用SSG渲染
    },
  ],

  // 模块注册
  modules: ["@element-plus/nuxt"],
  plugins: [
    {src:'~/plugins/store-cache',ssr:false}
  ],  
  elementPlus: {},
});
